<!-- ruleList.html 2017-06-11 14:36:38-->
#@HplusLayout()
	#define content()
<div style="padding:0 10px;height: 100%">
	<div id="AdvanceSearch" style="padding:15px;display: none">
		<form class="form-horizontal" novalidate="novalidate" onsubmit="return bootstrapTableRefresh()">
	    <div class="form-group">
				<label class="col-xs-3 control-label">素材类型：</label>
				<div class="col-xs-8">
					<select name="type" class="form-control">
						#(data("WEIXIN_MATERIAL_TYPE","option",type))
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="col-xs-8 col-xs-offset-3">
					<button type="reset" class="btn btn-default">清空</button> <button type="submit" class="btn btn-primary">开始查询</button>
				</div>
			</div>
		</form>
	</div>
	<div id="toolbar">
	<button onclick="layer.open({area: ['450px', 'auto'],content:$('#AdvanceSearch'),type:1,shade: false,title:'搜索'});" type="button" class="btn btn-outline btn-default"><i class="glyphicon glyphicon-search"></i></button>
		<a href="batchDeleteMaterial" class="btn btn-outline btn-default" target="selectedTodo" rel="btSelectItem" title="确定删除这些素材？"><i class="glyphicon glyphicon-trash"></i></a>
	</div>
	<table id="bootstrapTable" data-id-field="media_id" data-url="materialList" data-sort-name="id" data-sort-order="desc">
		<thead>
			<tr>
				<th data-checkbox="true"></th>
				<th data-formatter="xuhaoFormatter" data-align="center" data-width="70px">序号</th>
				<th data-field="media_id" data-align="center">media_id</th>
				<th data-align="center" data-formatter="contentFormatter">内容</th>
				<th data-formatter="caozuoFormatter">操作</th>
			</tr>
		</thead>
	</table>
</div>
#end
#define css()
<link href="#(path)/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
#end
#define js()
<script src="#(path)/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="#(path)/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
#end
#define jsFunction()
<script>
	function caozuoFormatter(value,row,index){
		var str = "";
		return str;
	}
	function contentFormatter(value,row,index){
		var str = "";
		if(row.name){
			str = "<a href='"+row.url+"' target='_blank'>"+row.name+"</a>";
		}else {
			$.each(row.content.news_item,function(index,item){
				str = str +"<a href='"+item.url+"' target='_blank'>"+item.url+"</a><br/>";
			});
		}
		return str;
	}
</script>
#end